package com.example.mcpweather.config;

import com.example.mcpweather.tool.McpDemoTool;
import com.example.mcpweather.tool.McpWeatherTool;
import com.example.mcpweather.tool.SearchNews;
import com.example.mcpweather.tool.ToDayInHistorySearch;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MCPServerConfig {

    @Bean
    public ToolCallbackProvider weatherTools(McpWeatherTool mcpWeatherTool){
        return MethodToolCallbackProvider.builder().toolObjects(mcpWeatherTool).build();
    }
    @Bean
    public ToolCallbackProvider demoTools(McpDemoTool mcpDemoTool){
        return MethodToolCallbackProvider.builder().toolObjects(mcpDemoTool).build();
    }
    @Bean
    public ToolCallbackProvider toDayInHistory(ToDayInHistorySearch toDayInHistory){
        return MethodToolCallbackProvider.builder().toolObjects(toDayInHistory).build();
    }
    @Bean
    public ToolCallbackProvider SearchNews(SearchNews searchNews){
        return MethodToolCallbackProvider.builder().toolObjects(searchNews).build();
    }

}
